import request from "../utils/request";

// 获取全部订单
export function getGroupList() {
  return request({
    url: "/group/getAll",
    method: "get",
  });
}

// 通过管理员id获取
export function groupByAdmainAPI(admainId) {
  return request({
    url: "group/byAdmain",
    method: "GET",
    params: {
      admainId
    },
  });
}

// 删除拼团
export function deleteGRroupAPI(groupId) {
  return request({
    url: "group/deleteGRroup",
    method: "GET",
    params: {
      groupId
    },
  });
}

// 添加拼团
export function addGroupAPI(groupBuying) {
  return request({
    url: "group/add",
    method: "POST",
    data: {
      groupAddre: groupBuying.groupAddre,
      groupImg: groupBuying.groupImg,
      groupPrice: groupBuying.groupPrice,
      groupSum: groupBuying.groupSum,
      groupPhone: groupBuying.groupPhone,
      groupText: groupBuying.groupText,
      groupTime: groupBuying.groupTime,
      groupDay: groupBuying.groupDay,
      groupUser: groupBuying.groupUser
    },
  });
}